import java.awt.Image;

import javax.swing.filechooser.FileSystemView;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;

public class Assobot {
	/**
	 * @param args
	 */
	//private static int n = 0;
	static int toolbarWidth = 200;
	static int toolbarHeight = 600;
	static int windowHeight = 640;
	
	public static void main(String[] args) {
		
		Loggy.build();    
		Display display = new Display();
		Map map = Map.getInstance();
		Shell shell = new Shell(display);
		 shell.setBounds(10,10,200,200);
		shell.setText("ASSObot");
		shell.setBounds(100, 100, map.width+toolbarWidth, windowHeight);
		shell.setLayout(null);
		
		map.startGUI(shell);
		
		map.createRobot(50, 60,"Eva", "img/eva.png");
		map.createRobot(500, 300, "McQueen", "img/LightMcQueen.png");
		map.createRobot(400, 300, "Linux","img/linuxbot.png");
		map.createRobot(250, 400, "Scott", "img/scottbot.png");

		map.createRobot(40, 100, "Sucata","img/sucatabot.png");
		map.createRobot(100, 100, "Monster", "img/Monsters_4.png");
		
		FileSystemWatcher fsw = new FileSystemWatcher(1000, "Movements", "Attacks", display);
		
		
		Capabilities capabilities = Capabilities.getInstance();
		fsw.registerObserver(capabilities);		
		capabilities.startGUI(shell, map.width, 0, toolbarWidth, toolbarHeight);
		map.robots.get(0).speed=10;
		map.startGame();
		
		map.robots.get(1).speed = 10;
		map.robots.get(1).angle = 90;
		shell.open();
		
		
		while (!shell.isDisposed()){
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
